﻿using System.Data.Entity.ModelConfiguration;

namespace wh40klbModel.ModelConfiguration
{
    class InfantryWargearUtilisationConfiguration : EntityTypeConfiguration<InfantryWargearUtilisation>
    {
        public InfantryWargearUtilisationConfiguration()
        {
            //Cle Primaire et table
            HasKey(iwu => new { iwu.InfantryId, iwu.WargearId });
            //Propriete
            Property(iwu => iwu.MaximumUtilisation).IsRequired();
            Property(iwu => iwu.MinimumUtilisation).IsRequired();
            Property(iwu => iwu.Ratio).IsRequired();
            Property(iwu => iwu.UnitaryCost).IsRequired();
            //cle etrangere
            HasRequired(iwu => iwu.Infantry).WithMany(i => i.Wargears);
            HasRequired(iwu => iwu.Wargear).WithMany(w => w.Infantries);





        }
    }
}
